<?php /* PROJECTS $Id: do_project_aed.php,v 1.11.10.4 2006/07/25 20:24:13 merlinyoda Exp $ */
$obj = new CTask();
$task_id = intval( dPgetParam( $_GET, 'task_id', 0 ) );
$obj->load($task_id);
$reasons = $obj->canComplete(TRUE);
if(is_array($reasons) && count($reasons) > 0) {
	$AppUI->setMsg( '<p/>'. implode("<br/>", $reasons), UI_MSG_ERROR );
	$AppUI->redirect();
	exit;
}
$obj->task_is_complete = 1;
$obj->task_percent_complete = 100;
if (($msg = $obj->store())) {
	$AppUI->setMsg( $msg, UI_MSG_ERROR );
	$AppUI->redirect();
	exit;
}
$AppUI->redirect();
?>